<template>
<a-card :bordered="false" class="card-area">
    <!-- 查询区域 11111-->
<div class="table-page-search-wrapper">
  <a-form layout="inline" :label-col="labelCol" @keyup.enter.native="searchQuery">
    <a-row :gutter="24">

        <a-col :md="6" :sm="8">
            <a-form-item label="项目编码唯 一">
                <a-input placeholder="请输入项目编码唯 一" v-model="queryParam.projectCode"></a-input>
            </a-form-item>
        </a-col>
        <a-col :md="6" :sm="8">
            <a-form-item label="单品名称">
                <a-input placeholder="请输入单品名称" v-model="queryParam.projectName"></a-input>
            </a-form-item>
        </a-col>
        <a-col :md="6" :sm="8">
            <a-form-item label="项目费用">
                <a-input placeholder="请输入项目费用" v-model="queryParam.amount"></a-input>
            </a-form-item>
        </a-col>
        <a-col :md="6" :sm="8">
            <a-form-item label="服务要求">
                <a-input placeholder="请输入服务要求" v-model="queryParam.serviceRequirement"></a-input>
            </a-form-item>
        </a-col>
        <a-col :md="6" :sm="8">
            <a-form-item label="服务计划">
                <a-input placeholder="请输入服务计划" v-model="queryParam.servicePlan"></a-input>
            </a-form-item>
        </a-col>
        <a-col :md="6" :sm="8">
            <a-form-item label="服务人员角色，1护士 2护工 3医生 4社工 5其他">
                <a-input placeholder="请输入服务人员角色，1护士 2护工 3医生 4社工 5其他" v-model="queryParam.opRole"></a-input>
            </a-form-item>
        </a-col>
        <a-col :md="6" :sm="8">
            <a-form-item label="医院机构编码">
                <a-input placeholder="请输入医院机构编码" v-model="queryParam.orgCode"></a-input>
            </a-form-item>
        </a-col>
        <a-col :md="6" :sm="8">
            <a-form-item label="租户id">
                <a-input placeholder="请输入租户id" v-model="queryParam.tenantId"></a-input>
            </a-form-item>
        </a-col>
        <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
           <a-col :md="6" :sm="24">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
           </a-col>
        </span>
    </a-row>
 </a-form>
</div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
        <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
        <a-button type="primary" icon="download" @click="handleExportXls">导出</a-button>
        <a-upload name="file" :showUploadList="false" :multiple="false" :action="importExcelUrl" @change="handleImportExcel">
            <a-button type="primary" icon="import">导入</a-button>
        </a-upload>
        <a-dropdown v-if="selectedRowKeys.length > 0">
            <a-menu slot="overlay">
                <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
            </a-menu>
            <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
        </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
        <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
            <i class="anticon anticon-info-circle ant-alert-icon"></i>
            <span>已选择</span>
            <a style="font-weight: 600">
                {{ selectedRowKeys.length }}
            </a>
            <span>项</span>
            <a style="margin-left: 24px" @click="onClearSelected">清空</a>
        </div>

        <a-table
                ref="table"
                size="middle"
                bordered
                rowKey="id"
                :columns="columns"
                :dataSource="dataSource"
                :pagination="ipagination"
                :loading="loading"
                :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                      <a-menu-item>
                        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                          <a>删除</a>
                        </a-popconfirm>
                      </a-menu-item>
                </a-menu>
          </a-dropdown>
        </span>

        </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <HChDoorProjectPackageDetail-modal ref="modalForm" @ok="modalFormOk"></HChDoorProjectPackageDetail-modal>
</a-card>
</template>
<script>
  import '@assets/less/TableExpand.less'
  import hChDoorProjectPackageDetailModal from './modules/HChDoorProjectPackageDetailModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import {putAction,getAction,postAction} from '@api/manage';
  import {frozenBatch} from '@api/api'

  export default {
    name: "h_ch_door_project_package_detailList",
    mixins:[JeecgListMixin],
    components: {
      HChDoorProjectPackageDetailModal
    },
    data () {
      return {
        description: '上门套餐项目明细管理页面',
        labelCol: { style: { width: '110px' } },
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
		   {
            title: '主键ID',
            align:"center",
            dataIndex: 'id'
           },
		   {
            title: '创建时间',
            align:"center",
            dataIndex: 'createTime'
           },
		   {
            title: '编辑时间',
            align:"center",
            dataIndex: 'updateTime'
           },
		   {
            title: '项目编码唯 一',
            align:"center",
            dataIndex: 'projectCode'
           },
		   {
            title: '单品名称',
            align:"center",
            dataIndex: 'projectName'
           },
		   {
            title: '项目ID. 取door_service_project，有可能是空的',
            align:"center",
            dataIndex: 'projectId'
           },
		   {
            title: '服务内容',
            align:"center",
            dataIndex: 'content'
           },
		   {
            title: '项目费用',
            align:"center",
            dataIndex: 'amount'
           },
		   {
            title: '服务要求',
            align:"center",
            dataIndex: 'serviceRequirement'
           },
		   {
            title: '服务计划',
            align:"center",
            dataIndex: 'servicePlan'
           },
		   {
            title: '服务描述大文本',
            align:"center",
            dataIndex: 'description'
           },
		   {
            title: '描述',
            align:"center",
            dataIndex: 'remark'
           },
		   {
            title: '服务人员角色，1护士 2护工 3医生 4社工 5其他',
            align:"center",
            dataIndex: 'opRole'
           },
		   {
            title: '医院机构编码',
            align:"center",
            dataIndex: 'orgCode'
           },
		   {
            title: '租户id',
            align:"center",
            dataIndex: 'tenantId'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
		url: {
          list: "/system/hChDoorProjectPackageDetail/list",
          delete: "/system/hChDoorProjectPackageDetail/delete",
          deleteBatch: "/system/hChDoorProjectPackageDetail/deleteBatch",
          exportXlsUrl: "system/hChDoorProjectPackageDetail/exportXls",
          importExcelUrl: "system/hChDoorProjectPackageDetail/importExcel",
       },
     }
    },
    computed: {
     importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
     }
    },
    methods: {

    }
  }
</script>
<style scoped>
    @import '~@assets/less/common.less';
</style>